import request from '@/utils/request'
import qs from 'qs'

// api/users
export const getUsers = params => {
  return request({
    url: '/account/page?' + qs.stringify(params),
    method: 'POST'
  })
}
// 新增修改
export const postUsers = data => {
  return request({
    url: '/account/save?' + qs.stringify(data),
    method: 'POST'
  })
}
// 启用禁用 /account/switch
export const switchUsers = data => {
  return request({
    url: '/account/switch?' + qs.stringify(data),
    method: 'POST'
  })
}
// 删除用户 account/delete
export const deleteUsers = data => {
  return request({
    url: '/account/delete?' + qs.stringify(data),
    method: 'POST'
  })
}

// /account/get 获取账户信息
export const getUser = data => {
  return request({
    url: '/account/get?' + qs.stringify(data),
    method: 'POST'
  })
}

// 修改密码
export const changePassword = data => {
  return request({
    url: '/account/updatePassword?' + qs.stringify(data),
    method: 'POST'
  })
}
